import request from '@/utils/request'

// 创建意见反馈
export function createOpinion(data) {
  return request({
    url: '/mini/opinion/create',
    method: 'post',
    data: data
  })
}

// 更新意见反馈
export function updateOpinion(data) {
  return request({
    url: '/mini/opinion/update',
    method: 'put',
    data: data
  })
}

// 删除意见反馈
export function deleteOpinion(id) {
  return request({
    url: '/mini/opinion/delete?id=' + id,
    method: 'delete'
  })
}

// 获得意见反馈
export function getOpinion(id) {
  return request({
    url: '/mini/opinion/get?id=' + id,
    method: 'get'
  })
}

// 获得意见反馈分页
export function getOpinionPage(query) {
  return request({
    url: '/mini/opinion/page',
    method: 'get',
    params: query
  })
}

// 导出意见反馈 Excel
export function exportOpinionExcel(query) {
  return request({
    url: '/mini/opinion/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
